<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>西点云产品管理平台</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <style>
        :root {
            --ace-primary: #438EB9;
            --ace-success: #87B87F;
            --ace-info: #6FB3E0;
            --ace-warning: #FFAC59;
            --ace-danger: #DD5A43;
            --ace-sidebar: #2F4050;
            --ace-sidebar-hover: #364150;
        }
        body {
            font-family: 'Inter', sans-serif !important;
            background-color: #f8f9fa !important;
            font-size: 14px;
        }
        .navbar-ace {
            background: #fff !important;
            border-bottom: 1px solid #e7eaec;
            box-shadow: 0 2px 4px rgba(0,0,0,0.08);
            height: 60px;
        }
        .navbar-brand {
            font-weight: 600 !important;
            color: var(--ace-primary) !important;
            font-size: 18px !important;
        }
        .sidebar-ace {
            background: var(--ace-sidebar) !important;
            min-height: calc(100vh - 60px);
            width: 220px;
            position: fixed;
            top: 60px;
            left: 0;
            z-index: 1000;
        }
        .sidebar-ace .nav-header {
            padding: 20px 25px 10px;
            color: #a7b1c2;
            font-weight: 600;
            font-size: 11px;
            text-transform: uppercase;
        }
        .sidebar-ace .nav-link {
            color: #a7b1c2 !important;
            padding: 12px 25px;
            border-left: 3px solid transparent;
            text-decoration: none;
        }
        .sidebar-ace .nav-link:hover,
        .sidebar-ace .nav-link.active {
            background: var(--ace-sidebar-hover) !important;
            color: #fff !important;
            border-left-color: var(--ace-primary);
        }
        .main-content {
            margin-left: 220px;
            margin-top: 60px;
            padding: 30px;
            background: #f8f9fa;
            min-height: calc(100vh - 60px);
        }
        .page-header {
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 1px solid #e7eaec;
        }
        .page-title {
            font-size: 24px;
            font-weight: 600;
            color: #2f4050;
            margin: 0;
        }
        .page-subtitle {
            color: #676a6c;
            font-size: 14px;
            margin: 5px 0 0 0;
        }
        .card-ace {
            border: 1px solid #e7eaec;
            border-radius: 6px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.12);
            margin-bottom: 20px;
            background: #fff;
        }
        .card-ace .card-header {
            background: #f8f9fa;
            border-bottom: 1px solid #e7eaec;
            padding: 15px 20px;
            font-weight: 600;
            color: #2f4050;
        }
        .card-ace .card-body {
            padding: 20px;
        }
        .stat-card {
            background: #fff;
            border: 1px solid #e7eaec;
            border-radius: 6px;
            padding: 20px;
            text-align: center;
            transition: all 0.3s ease;
            margin-bottom: 20px;
        }
        .stat-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
        .stat-card .stat-icon {
            font-size: 32px;
            margin-bottom: 10px;
        }
        .stat-card .stat-number {
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 5px;
        }
        .stat-card .stat-label {
            color: #676a6c;
            font-size: 12px;
            text-transform: uppercase;
        }
        .btn-ace-primary {
            background: var(--ace-primary) !important;
            border-color: var(--ace-primary) !important;
            color: #fff !important;
        }
        .btn-ace-success {
            background: var(--ace-success) !important;
            border-color: var(--ace-success) !important;
            color: #fff !important;
        }
        .btn-ace-info {
            background: var(--ace-info) !important;
            border-color: var(--ace-info) !important;
            color: #fff !important;
        }
        .btn-ace-warning {
            background: var(--ace-warning) !important;
            border-color: var(--ace-warning) !important;
            color: #fff !important;
        }
        .btn-ace-danger {
            background: var(--ace-danger) !important;
            border-color: var(--ace-danger) !important;
            color: #fff !important;
        }
        .table-ace {
            background: #fff;
            border-radius: 6px;
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0,0,0,0.12);
        }
        .table-ace thead th {
            background: #f8f9fa;
            border-bottom: 1px solid #e7eaec;
            color: #2f4050;
            font-weight: 600;
            font-size: 12px;
            text-transform: uppercase;
            padding: 15px;
        }
        .table-ace tbody td {
            padding: 15px;
            border-bottom: 1px solid #f1f1f1;
            vertical-align: middle;
        }
        .table-ace tbody tr:hover {
            background: #f8f9fa;
        }
        .badge-ace {
            font-size: 11px;
            font-weight: 500;
            padding: 4px 8px;
            border-radius: 3px;
            color: #fff;
        }
        .badge-ace-primary { background: var(--ace-primary) !important; }
        .badge-ace-success { background: var(--ace-success) !important; }
        .badge-ace-warning { background: var(--ace-warning) !important; }
        .badge-ace-danger { background: var(--ace-danger) !important; }
        .badge-ace-info { background: var(--ace-info) !important; }
        .badge-ace-secondary { background: #95a5a6 !important; }
        .form-control-ace {
            border: 1px solid #e5e6e7;
            border-radius: 4px;
            padding: 10px 12px;
            font-size: 14px;
        }
        .form-control-ace:focus {
            border-color: var(--ace-primary);
            box-shadow: 0 0 0 0.2rem rgba(67, 142, 185, 0.25);
        }
        .form-label-ace {
            font-weight: 500;
            color: #2f4050;
            margin-bottom: 8px;
        }
        .breadcrumb-ace {
            background: transparent;
            padding: 0;
            margin-bottom: 20px;
        }
        .breadcrumb-ace .breadcrumb-item {
            color: #676a6c;
            font-size: 12px;
        }
        .breadcrumb-ace .breadcrumb-item.active {
            color: var(--ace-primary);
            font-weight: 600;
        }
        .breadcrumb-ace .breadcrumb-item a {
            color: #676a6c;
            text-decoration: none;
        }
        .breadcrumb-ace .breadcrumb-item a:hover {
            color: var(--ace-primary);
        }
        .text-primary {
            color: var(--ace-primary) !important;
        }
        .btn-outline-primary {
            color: var(--ace-primary) !important;
            border-color: var(--ace-primary) !important;
        }
        .btn-outline-primary:hover {
            background-color: var(--ace-primary) !important;
            border-color: var(--ace-primary) !important;
            color: #fff !important;
        }
        .btn-outline-danger {
            color: var(--ace-danger) !important;
            border-color: var(--ace-danger) !important;
        }
        .btn-outline-danger:hover {
            background-color: var(--ace-danger) !important;
            border-color: var(--ace-danger) !important;
            color: #fff !important;
        }
        .btn-outline-info {
            color: var(--ace-info) !important;
            border-color: var(--ace-info) !important;
        }
        .btn-outline-info:hover {
            background-color: var(--ace-info) !important;
            border-color: var(--ace-info) !important;
            color: #fff !important;
        }
        .btn-outline-secondary {
            color: #6c757d !important;
            border-color: #6c757d !important;
        }
        .btn-outline-secondary:hover {
            background-color: #6c757d !important;
            border-color: #6c757d !important;
            color: #fff !important;
        }
        .alert {
            border-radius: 6px;
            border: none;
        }
        .alert-info {
            background-color: rgba(111, 179, 224, 0.1);
            color: #2c5aa0;
            border-left: 4px solid var(--ace-info);
        }
        .alert-warning {
            background-color: rgba(255, 172, 89, 0.1);
            color: #8a6d3b;
            border-left: 4px solid var(--ace-warning);
        }
        .form-select {
            border: 1px solid #e5e6e7;
            border-radius: 4px;
            padding: 10px 12px;
            font-size: 14px;
        }
        .form-select:focus {
            border-color: var(--ace-primary);
            box-shadow: 0 0 0 0.2rem rgba(67, 142, 185, 0.25);
        }
        .form-control {
            border: 1px solid #e5e6e7;
            border-radius: 4px;
            padding: 10px 12px;
            font-size: 14px;
        }
        .form-control:focus {
            border-color: var(--ace-primary);
            box-shadow: 0 0 0 0.2rem rgba(67, 142, 185, 0.25);
        }
        .form-label {
            font-weight: 500;
            color: #2f4050;
            margin-bottom: 8px;
        }
        .form-text {
            color: #676a6c;
            font-size: 12px;
        }
        .form-check-input:checked {
            background-color: var(--ace-primary);
            border-color: var(--ace-primary);
        }
        .form-check-input:focus {
            border-color: var(--ace-primary);
            box-shadow: 0 0 0 0.2rem rgba(67, 142, 185, 0.25);
        }
        
        .pagination-ace {
            margin: 0;
        }
        
        .pagination-ace .page-item {
            margin: 0 2px;
        }
        
        .pagination-ace .page-link {
            border: 1px solid #e7eaec;
            color: #676a6c;
            padding: 8px 12px;
            border-radius: 4px;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.2s ease;
        }
        
        .pagination-ace .page-link:hover {
            background-color: #f8f9fa;
            border-color: var(--ace-primary);
            color: var(--ace-primary);
        }
        
        .pagination-ace .page-item.active .page-link {
            background-color: var(--ace-primary);
            border-color: var(--ace-primary);
            color: #fff;
        }
        
        .pagination-ace .page-item.disabled .page-link {
            color: #c5c5c5;
            background-color: #fff;
            border-color: #e7eaec;
        }
        
        .pagination-info {
            color: #676a6c;
            font-size: 13px;
            line-height: 32px;
        }
    </style>
</head>
<body>
    <!-- 顶部导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-ace fixed-top">
        <div class="container-fluid">
            <button class="sidebar-toggle" type="button">
                <i class="bi bi-list"></i>
            </button>
            <a class="navbar-brand" href="/">
                <i class="bi bi-gear-fill me-2"></i>西点云产品管理平台
            </a>
            <div class="navbar-nav ms-auto">
                <a class="nav-link" href="#">
                    <i class="bi bi-person-circle me-1"></i>@User.FindFirst("RealName")?.Value
                </a>
                <a class="nav-link" href="/Account/Logout">
                    <i class="bi bi-box-arrow-right"></i>
                </a>
            </div>
        </div>
    </nav>
    
    <!-- 侧边栏 -->
    <nav class="sidebar-ace">
        <div class="nav-header">导航菜单</div>
        <ul class="nav flex-column">
            <li class="nav-item">
                <a class="nav-link" href="/">
                    <i class="bi bi-house"></i>首页
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/Product">
                    <i class="bi bi-box-seam"></i>产品管理
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/Department">
                    <i class="bi bi-building"></i>部门管理
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/Enterprise">
                    <i class="bi bi-buildings"></i>企业管理
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/Version">
                    <i class="bi bi-tags"></i>版本管理
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/DeployedApplication">
                    <i class="bi bi-cloud-check"></i>已部署应用
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/User">
                    <i class="bi bi-people"></i>用户管理
                </a>
            </li>
        </ul>
    </nav>
    
    <!-- 主内容区 -->
    <main class="main-content">
        @RenderBody()
    </main>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    
    <!-- Loading 动画 -->
    <div id="globalLoading" class="loading-overlay" style="display: none;">
        <div class="loading-spinner">
            <div class="spinner-border text-primary" role="status">
                <span class="visually-hidden">Loading...</span>
            </div>
            <div class="loading-text">处理中...</div>
        </div>
    </div>
    <script>
        // 侧边栏切换
        document.querySelector('.sidebar-toggle')?.addEventListener('click', function() {
            document.querySelector('.sidebar-ace').classList.toggle('show');
        });
        
        // 设置当前页面的导航高亮
        const currentPath = window.location.pathname;
        document.querySelectorAll('.sidebar-ace .nav-link').forEach(link => {
            if (link.getAttribute('href') === currentPath) {
                link.classList.add('active');
            }
        });
    </script>

    <!-- Loading 动画 -->
    <div id="globalLoading" class="loading-overlay" style="display: none;">
        <div class="loading-spinner">
            <div class="spinner-border text-primary" role="status">
                <span class="visually-hidden">Loading...</span>
            </div>
            <div class="loading-text">处理中...</div>
        </div>
    </div>
    
    <!-- 删除确认对话框 -->
    <div class="modal fade" id="deleteConfirmModal" tabindex="-1">
        <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content">
                <div class="modal-header border-0 pb-0">
                    <div class="d-flex align-items-center">
                        <div class="modal-icon-danger me-3">
                            <i class="bi bi-exclamation-triangle"></i>
                        </div>
                        <h5 class="modal-title mb-0">确认删除</h5>
                    </div>
                    <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                </div>
                <div class="modal-body pt-2">
                    <p class="mb-2">您确定要删除 <strong id="deleteItemName"></strong> 吗？</p>
                    <p class="text-muted small mb-0" id="deleteWarning">此操作不可恢复！</p>
                </div>
                <div class="modal-footer border-0 pt-0">
                    <button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">
                        <i class="bi bi-x-circle me-1"></i>取消
                    </button>
                    <button type="button" class="btn btn-danger" id="confirmDeleteBtn">
                        <i class="bi bi-trash me-1"></i>确认删除
                    </button>
                </div>
            </div>
        </div>
    </div>

    <script>
        let deleteForm = null;
        
        function showDeleteConfirm(itemName, form, customWarning = null) {
            deleteForm = form;
            document.getElementById('deleteItemName').textContent = itemName;
            if (customWarning) {
                document.getElementById('deleteWarning').textContent = customWarning;
            } else {
                document.getElementById('deleteWarning').textContent = '此操作不可恢复！';
            }
            
            const modal = new bootstrap.Modal(document.getElementById('deleteConfirmModal'));
            modal.show();
        }
        
        document.getElementById('confirmDeleteBtn').addEventListener('click', function() {
            if (deleteForm) {
                deleteForm.submit();
            }
        });
        
        // 全局loading功能
        function showLoading() {
            document.getElementById('globalLoading').style.display = 'flex';
        }
        
        function hideLoading() {
            document.getElementById('globalLoading').style.display = 'none';
        }
        
        // 表单提交时显示loading
        document.querySelectorAll('form').forEach(form => {
            form.addEventListener('submit', function() {
                showLoading();
            });
        });
        
        // 页面加载完成后隐藏loading
        window.addEventListener('load', function() {
            hideLoading();
        });
    </script>

    <style>
        .modal-icon-danger {
            width: 48px;
            height: 48px;
            background: linear-gradient(135deg, #ff6b6b, #ee5a52);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.5rem;
        }
        
        .modal-content {
            border: none;
            border-radius: 15px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.15);
        }
        
        .modal-header {
            padding: 2rem 2rem 0;
        }
        
        .modal-body {
            padding: 1rem 2rem;
        }
        
        .modal-footer {
            padding: 0 2rem 2rem;
        }
        
        .btn-danger {
            background: linear-gradient(135deg, #ff6b6b, #ee5a52);
            border: none;
            transition: all 0.3s ease;
        }
        
        .btn-danger:hover {
            background: linear-gradient(135deg, #ee5a52, #dc4c64);
            transform: translateY(-1px);
            box-shadow: 0 5px 15px rgba(238, 90, 82, 0.4);
        }
        
        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 9999;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .loading-spinner {
            text-align: center;
            color: white;
        }
        
        .loading-text {
            margin-top: 10px;
            font-size: 14px;
        }
        
        .card-footer {
            background-color: #f8f9fa;
            border-top: 1px solid #e7eaec;
            padding: 15px 20px;
        }
    </style>
</body>
</html>